package edu.ucsd.cse222b.simulator;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;

import edu.ucsd.cse222b.network.DCNetwork;

public final class Driver {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DCNetwork network=DCNetwork.getInstance();
		
		network.buildFatTree(4);
		BufferedReader reader=null;
		try {
			reader=new BufferedReader(new InputStreamReader(new FileInputStream(args[0])));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		network.createFlows(reader);
		
		network.execute();
		
		System.out.println("Simulation finished");
		
		System.out.println("Total Energy = " + network.getEnergyConsumption());
	}

}
